package mime

import (
	"mime"
	"path"
)

func GetContentType(filepath string) string {
	contentType := "application/octet-stream"
	ext := path.Ext(filepath)
	if ext != "" && ext != "." {
		mt := mime.TypeByExtension(ext)
		if mt != "" {
			contentType = mt
		}
	}
	return contentType
}
